package com.hx.setting.entity;

import java.io.Serializable;
import java.util.Date;
import org.json.JSONObject;

/**
 * Generate Date : 2014-03-16
 * Generate Version : v3.0
 * Generate Name : Honey v3.1 Test
 * Generate User : THINK
 * JDK Version : 1.5
 */
public class GroupsEntityWithBLOBs extends GroupsEntity implements Serializable
{

	/** 类序列化版本标识 */
	private static final long	serialVersionUID	= -314452337237726416L;

	/** 组描述 */
	private String				description;

	/** 
	 * 默认构造函数
	 */
	public GroupsEntityWithBLOBs()
	{
		super();
	}

	/** 
	 * 带参数构造函数
	 */
	public GroupsEntityWithBLOBs(Long id/*id */, String groupName/*组名称 */, String description/*组描述 */)
	{
		//父类构造函数
		super( id/*id */
		, groupName/*组名称 */
		);
		this.setDescription( description );//组描述;
	}

	/** 
	 * 获取组描述
	 * @return 组描述
	 */
	public final String getDescription()
	{
		return this.description;
	}

	/** 
	 * 设定组描述
	 * @param description
	 * @return 返回自身
	 */
	public final GroupsEntity setDescription(String description)
	{
		this.description = description;
		if ( this.description != null && this.description.length() == 0 ) this.description = null;
		return this;
	}

	@Override
	public int hashCode()
	{
		int answer = -1;
		String solt = ":0X']";//随机盐
		answer = new StringBuilder().append( "GroupsEntityWithBLOBs" ).append( super.hashCode() ).append( this.description ).append( solt ).toString().hashCode();
		return answer;
	}

	@Override
	public String toString()
	{
		return new StringBuilder()
				.append( super.toString() )
				.append( "\nGroupsEntityWithBLOBs : [" )
				.append( "    description : " )
				.append( this.description )
				.append( "]\n" )
				.toString();
	}

	public JSONObject toJsonObject()
	{
		JSONObject answer = super.toJsonObject();
		answer.put( "description" ,description == null ? "" : description );
		return answer;
	}

	public String toXml()
	{
		StringBuilder answer = new StringBuilder();
		String superxmpl = super.toXml();
		int endindex = superxmpl.lastIndexOf( '<' );
		answer.append( superxmpl.substring( 0 ,endindex ) );
		answer.append( "  <description>" ).append( description == null ? "" : description ).append( "</description>\n" );
		answer.append( superxmpl.substring( endindex ) );
		return answer.toString();
	}
}
/* Honey v3.1 Test - version:4 - OriginalChecksum:Bc568c697931c4213377c71ced94fcae6 (do not edit this line) */
